ubuntu18.04搭建rtmp server | 您所在的位置:网站首页 › nodejs rtmp › ubuntu18.04搭建rtmp server |
在Ubuntu 18.04上搭建RTMP服务器可以通过以下步骤完成: 安装Nginxsudo apt update sudo apt install nginx 安装RTMP模块sudo apt install libnginx-mod-rtmp 配置Nginx编辑Nginx配置文件 sudo nano /etc/nginx/nginx.conf 在http部分添加RTMP配置 rtmp { server { listen 1935; #RTMP默认端口 chunk_size 4096; application live { live on; recordoff; } } } 重新启动Nginxsudo systemctl restart nginx 使用FFmpeg推流ffmpeg -re -i D:\Users\test.mkv -vcodec copy -codec copy -f flv -flvflags no_duration_filesize rtmp://192.168.47.128/live/test,默认的推流地址是:rtmp:///live/,其中可以自己定义。 有可能会报以下错误: Failed to update header with correct duration. Failed to update header with correct filesize.stackoverflow上面有答案: 使用VLC播放器播放可以使用VLC等支持RTMP协议的播放器进行播放,默认的播放地址是:rtmp:///live/,其中需要和推流时定义的一致。 |
CopyRight 2018-2019 实验室设备网 版权所有 |